import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index/index.vue'

Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
// 修改 原型对象中的push方法
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err=>err)
}


const routes = [
  {
    path: '/',
    name: 'index',
    component: Index,
    meta:{
      isShowTabBar:true//显示
  }
  },
  {
    path: '/books',
    name: 'books',
    component: () => import('../views/books/books.vue'),
    meta:{
      isShowTabBar:true//显示
  }
  },
  {
    path: '/statistical',
    name: 'statistical',
    component: () => import('../views/statistical/statistical.vue'),
    meta:{
      isShowTabBar:true//显示
  }
  },
  {
    path: '/newCost',
    name: 'newCost',
    component: () => import('../views/newCost/newCost.vue'),
    meta:{
      isShowTabBar:false//显示
  }
  },
  {
    path: '/moneyType',
    name: 'moneyType',
    component: () => import('../views/moneyType/moneyType.vue')
 
  },
  {
    path: '/share',
    name: 'share',
    component: () => import('../views/share/share.vue')
 
  },
  // {
  //   path: '/notice',
  //   name: 'notice',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import('../views/notice/notice.vue')
  // },
  // {
  //   path: '/reply',
  //   name: 'reply',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import('../views/reply/reply.vue')
  // },
  // {
  //   path: '/manage',
  //   name: 'manage',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import('../views/manage/manage.vue')
  // },
  // {
  //   path: '/ledger',
  //   name: 'ledger',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import('../views/ledger/index.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
